const path = require("path");
const {resolve} = require("./alias.config");
module.exports = {
    lintOnSave: false, //是否开启eslint
    publicPath: process.env.NODE_ENV === 'production' ? '' : '/',
    productionSourceMap: false,
    configureWebpack: {
        resolve
    },
    // pluginOptions: {
    //     'style-resources-loader': {
    //         preProcessor: 'sass',
    //         patterns: []
    //     }
    // },
    chainWebpack: config => {
        // 修复HMR
        config.resolve.symlinks(true);
        config.plugin('html')
            .tap(args => {
                args[0].title = 'sking-admin'
                return args
            })
    },
    devServer: {
        port: 8081,
        open: true,
        overlay: {
            warnings: false,
            errors: true
        },
        proxy: {
            "/": {
                target: 'http://127.0.0.1:8080/',
                changeOrigin: true, // 是否改变域名
                ws: true,
                pathRewrite: {
                    // 路径重写
                    '^/': ''
                }
            }
        }
    }
}

